package com.allwees.bs.module.wms.rest;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.allwees.bs.core.modelbase.vo.R;
import com.allwees.bs.module.core.rest.BoCrudApi;
import com.allwees.bs.module.wms.entity.WmsAllocateOrderSku;
import com.allwees.bs.module.wms.req.JoinToPickOrderReq;
import com.allwees.bs.module.wms.req.query.WmsAllocateOrderSkuQueryReq;
import com.allwees.bs.module.wms.service.WmsAllocateOrderSkuService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/backstage/api/wms/allocate_order")
public class WmsAllocateOrderSkuApi extends BoCrudApi<WmsAllocateOrderSku, WmsAllocateOrderSkuService> {

    @GetMapping("/page")
    public R page(Page<WmsAllocateOrderSku> page, WmsAllocateOrderSkuQueryReq req){
        return super.page(page, req);
    }

    @PostMapping("/join_pick")
    public R genPickOrder(@RequestBody JoinToPickOrderReq req){
        int count = boService.joinToPick(req);
        return R.ok(count);
    }
}
